from socket import *

s = socket(AF_INET,SOCK_DGRAM)
s.bind(("",60255))
addr = ("192.168.31.181",8080)
date = input("请输入要发送的内容：")
s.sendto(date.encode("gb2312"),addr)
# s.sendto("你好".encode("gb2312"),("192.168.31.181",8080))
redate = s.recvfrom(1024)
print(redate[0].decode("gb2312"),redate[1])
s.close()
